#ifndef FACTORYVIEW_H_
#define FACTORYVIEW_H_

#include "scHeader.h"
#include <QObject>
#include <QString>

namespace sybilpm
{

/**
 * The factory for all WidSybilView derived views.
 */
class FactoryView : public QObject
{
	Q_OBJECT
	struct ViewData
	{
		ViewData(int type, SybilViewCreator creator, const std::string & nameTechnical, QString nameDisplay, QString description) :
			type(type), cre(creator), nameTech(nameTechnical), nameDisp(nameDisplay), desc(description) {}
		int type;
		SybilViewCreator cre;
		std::string nameTech;
		QString nameDisp, desc;
	};
public:
	static FactoryView * get();
	bool addProduct(int type, SybilViewCreator creator, SybilViewTranslationCreator transCreator);
	WidSybilView * create(int type, QWidget * parent) const;
	std::vector<int> getViewTypes() const;
	const std::string & getTechnicalName(int type) const;
	QString getDisplayName(int type) const;
	QString getDescription(int type) const;

private:
	typedef std::map<int, ViewData *> Products;
	FactoryView();
	~FactoryView();
	static FactoryView * inst;
	Products products;
};

} // namespace sybilpm

#endif /* FACTORYVIEW_H_ */
